﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using Hongapo_Common;
using System.Data;

public partial class sysadmin_Users_userlist : PageBase
{

    Hongapo_Services.Users.Users service = new Hongapo_Services.Users.Users();
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            BindRepetear();
        }
    }

    private void BindRepetear()
    {
        DataSet dt = service.GetList(" 1=1");
        this.rptList.DataSource = dt;
        this.rptList.DataBind();
    }


    /// <summary>
    ///  停用
    /// </summary>
    /// <param name="e"></param>
    /// <param name="sender"></param>
    protected void btnStop_Click(object sender, EventArgs e)
    {
        Button btn = sender as Button;
        int isopen = 0;
        if (btn.Text.Equals("启用"))
        {
            isopen = 1;
        }
        int id = TypeConvert.ToInt32(btn.CommandArgument);
        bool flag = service.StopOrOpen(id, isopen);
        if (flag)
        {
            this.Show("操作成功!", "userlist.aspx");
        }
    }
}
